<?php 
$appId = 'wxe214ac48790c622f';
$secret = '62d3091e10b72a50a8a2c4f758a799b2';
include 'jssdk.php';
$jssdk = new JSSDK($appId, $secret);
$signPackage = @$jssdk->GetSignPackage();
 
?><!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Finish</title>
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<link rel="stylesheet" href="https://res.wx.qq.com/open/libs/weui/1.1.2/weui.min.css">
<style>
template{width:100%;height:100px;display:block;}
</style></head><body>

<wx-open-launch-weapp
  id="launch-btn"
  username="gh_0ba06e332afa" style="width:100%;height:100px;"
>
  <template>
    <style>.btn { padding: 12px }</style>
    <button class="btn">打开小程序</button>
  </template>
</wx-open-launch-weapp>
<script>
  var btn = document.getElementById('launch-btn');
  btn.addEventListener('launch', function (e) {
    console.log('success');
  });
  btn.addEventListener('error', function (e) {
    console.log('fail', e.detail);
  });
</script>

<script src="http://mat1.gtimg.com/libs/jquery2/2.1.4/jquery2.min.js"></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<script>

$(function(){

	wx.config({
			  debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印
			  appId: '<?php echo $signPackage["appId"];?>',timestamp: <?php echo $signPackage["timestamp"];?>,
			  nonceStr: '<?php echo $signPackage["nonceStr"];?>',signature: '<?php echo $signPackage["signature"];?>',
						jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage'],
			  openTagList: ['wx-open-launch-app','wx-open-launch-weapp'] // 可选，需要使用的开放标签列表，例如['wx-open-launch-app']
	   });




});

</script>